#pragma once
#include "stdafx.h"
#include "EntityControl.h"
#include "TriggerAction.h"
#include "TriggerRequirement.h"

class EntityControl;
class TriggerAction;
class TriggerRequirement;

class Trigger
{

	std::vector<TriggerRequirement*> TriggerRequirements;
	std::vector<TriggerAction*> TriggerActions;

	//Checks the requirements fot the trigger
	bool CheckReq(EntityControl *entity);
	//Fires the trigger, if returns with true the trigger must be deleted
	bool FireTrigger(EntityControl *entity);
public:
	Trigger(void);
	~Trigger(void);

	
	//Template method for using a trigger, returns true is the trigger must be deleted
	bool UseTrigger(EntityControl *entity);

	void addRequiement(TriggerRequirement* req);
	void addAction(TriggerAction* action);
};

